#!/usr/bin/perl
# Nikto GUI ver.2 by cross <cross@x1machine.com>
use Gtk2 qw/-init -threads-init/;
######################################################## MODULES HERE !!!!! ##############################
use File::Temp 'tempfile';
use Symbol qw/gensym qualify qualify_to_ref/;
sub _is_wperl { $^O eq 'MSWin32' && basename($^X) eq 'wperl.exe' }
sub newExProxy
{ my $class = shift; my ($orig_fh, $capture_var, $merge_fh, $capture_file) = @_;
$orig_fh = qualify($orig_fh); my $fhref = qualify_to_ref($orig_fh);
my $saved_fh;{ no strict
'refs'; if ( defined fileno($orig_fh) && ! _is_wperl
() ) { $saved_fh = gensym
; open $saved_fh, ">&$orig_fh"; }} my ($newio_fh, $newio_file);if ( ! $merge_fh ) {$newio_fh = gensym;
if ($capture_file) { $newio_file = $capture_file;} else { (undef, $newio_file) = tempfile
;} open $newio_fh, "+>$newio_file";} else { $newio_fh = qualify
($merge_fh);} bless [$$, $orig_fh, $saved_fh, $capture_var, $newio_fh, $newio_file, $capture_file], $class;} sub DESTROY
{ my $self = shift; my ($pid, $orig_fh, $saved_fh, $capture_var, $newio_fh,
$newio_file, $capture_file) = @$self; return unless $pid eq
$$; my $fh_ref = Symbol
::qualify_to_ref($orig_fh); select((select ($fh_ref), $|=1)[0]); if (ref $capture_var && $newio_file) {local $^W; seek $newio_fh, 0, 0; $$capture_var
= do {local $/; <$newio_fh>};}close $newio_fh if $newio_file; #########################################################
$CarpLevel = 0;
sub _capture (&@) { my ($code, $output, $error, $output_file, $error_file) = @_;
{ local $Carp::CarpLevel = 1; my $error = _validate
($output, $error, $output_file, $error_file); croak $error if $error;}
$_ = \do { my $s; $s = ''} unless ref $_;$$_ = '' if $_ != \undef && !defined($$_);} }
my $should_merge = (defined $error && defined $output && $output == $error) ||
( !defined $output && !defined $error ) || 0; my ($capture_out, $capture_err);
if ( !defined $output || $output != \undef ) {
$capture_out = Capture::_proxy->newExProxy('STDOUT', $output, undef, $output_file );}
if ( !defined $error || $error != \undef ) {
my $capture_err = Capture::_proxy->newExProxy('STDERR', $error, ($should_merge ? 'STDOUT' : undef), $error_file );}
&$code();}
sub capture (&@) { return &_capture; }
sub capture_exec { my @args = @_; my ($output, $error);
_capture sub { system _shell_quote(@args) }, \$output, \$error;
return wantarray ? ($output, $error) : $output;} *qxx = \&capture_exec;
*_shell_quote = ($^O =~ /MSWin32/) ? \&_shell_quote_win32 : sub {@_};
sub _shell_quote_win32 {my @args; for (@_) {if (/[ \"]/) {(my $escaped = $_) =~ s/([\"])/\\$1/g;
push @args, '"' . $escaped . '"'; next; }push @args, $_ } return @args;}
sub _validate { my ($output, $error, $output_file, $error_file) = @_; my $msg = q{};
if ( defined $output && defined $error
&& defined $output_file && defined $error_file
&& $output == $error && $output != \undef
&& $output_file ne $error_file
) { $msg = "Merged STDOUT and STDERR, but specified different output and error files";}
elsif ( !defined $output && !defined $error
&& defined $output_file && defined $error_file
&& $output_file ne $error_file
) { $msg = "Merged STDOUT and STDERR, but specified different output and error files";}
return $msg;}
########################################################
use threads;
use threads::shared;
$|=1;
my $frame = Gtk2::Frame->new("Nikto Output");
my $sw = Gtk2::ScrolledWindow->new (undef, undef);
my $tview = Gtk2::TextView->new();
my $MainBuffer = $tview->get_buffer();
my $supaBox = Gtk2::VBox->new(0,0);
#my $show_gui_output = Gtk2::CheckButton->new("Gui Output");
########################################################
my($ok_dbcheck, $ok_findonly, $ok_nolookup, $ok_ssl, $ok_single, $ok_useproxy,
$ok_config, $ok_cgidirs, $ok_id, $ok_port, $ok_timeout, $ok_pause, $ok_output,
$ok_display, $ok_evasion, $ok_format, $ok_mutate, $ok_tunning, $ok_root, $ok_vhost);
my $GUI_OUTPUT;
########################################################
%Ret = ( 'Return' => 0xff0d);
my $window = Gtk2::Window->new('toplevel');$window->signal_connect('delete_event' => sub { exit;});
Gtk2::Rc->parse ('/usr/share/themes/Qt/gtk-2.0/gtkrc');
$window->set_resizable(0);
$window->set_border_width(5);
$window->set_title("Nikto Gui");
my ($vbox) = &MainBox();
$window->add($vbox);
$window->show();
open (F, "nikto.pl") || $MainBuffer->insert ($MainBuffer->get_end_iter, "Cant find Nikto!\n"); close(F);
Gtk2->main();
sub MessageBox { my $message = shift; my $title = shift;
my $dialog = Gtk2::Dialog->new ($title, $window, 'destroy-with-parent', 'gtk-ok' => 'none');
my $label = Gtk2::Label->new ($message); $dialog->vbox->add ($label);
$dialog->signal_connect (response => sub { $_[0]->destroy }); $dialog->show_all;}
sub About {
MessageBox(
" [ Nikto Gui version 2.0 ]
(c)oded by cross // csrss
<cross\@x1machine.com> ", " Nikto Gui Info ");
}
sub MainBox { my $vbox = Gtk2::VBox->new(0,0);
############### COMMON OPTIONS ############################
my $tooltips = Gtk2::Tooltips->new;
#my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("nikto2.png");
#my $image = Gtk2::Image->new_from_pixbuf($pixbuf);
my $comop = Gtk2::HBox->new(0,0);
my $comon_options = Gtk2::Frame->new("Common Options");
my $dbcheck = Gtk2::CheckButton->new("Dbcheck");
$dbcheck->signal_connect(toggled => sub{ $ok_dbcheck = $dbcheck->get_active();});
$tooltips->set_tip($dbcheck, "Check database and other key files for syntax errors", "");
my $findonly = Gtk2::CheckButton->new("Findonly");
$tooltips->set_tip($findonly, "Find http(s) ports only, don't perform a full scan", "");
$findonly->signal_connect(toggled => sub{$ok_findonly = $findonly->get_active();});
my $nolookup = Gtk2::CheckButton->new("Nolookup");
$tooltips->set_tip($nolookup, "Skip name lookup", "");
$nolookup->signal_connect(toggled => sub{$ok_nolookup = $nolookup->get_active();});
my $ssl = Gtk2::CheckButton->new("Ssl");
$tooltips->set_tip($ssl, "Force ssl mode on port", "");
$ssl->signal_connect(toggled => sub{$ok_ssl = $ssl->get_active();});
my $single = Gtk2::CheckButton->new("Single");
$tooltips->set_tip($single, "Single request mode", "");
$single->signal_connect(toggled => sub{$ok_single = $single->get_active();});
my $proxy = Gtk2::CheckButton->new("Proxy");
$tooltips->set_tip($proxy, "Use the proxy
defined in config.txt
", ""); $proxy->signal_connect(toggled => sub{$ok_useproxy = $proxy->get_active();});
my $show_gui_output = Gtk2::CheckButton->new("Console Output");
$tooltips->set_tip($show_gui_output, "Check this if you want nikto output to be
produced in console window.", "");
$show_gui_output->signal_connect(toggled => sub{
$GUI_OUTPUT = $show_gui_output->get_active();
if($GUI_OUTPUT eq ""){$supaBox->add($frame); print "GUI MODE\n";}
if($GUI_OUTPUT eq "1"){$supaBox->remove($frame); print "CONSOLE MODE\n";}
});
$comop->pack_start($dbcheck,1,1,1);
$comop->pack_start($findonly,1,1,1);
$comop->pack_start($nolookup,1,1,1);
$comop->pack_start($ssl,1,1,1);
$comop->pack_start($single,1,1,1);
$comop->pack_start($proxy,1,1,1);
$comop->pack_start($show_gui_output,1,1,1);
$comon_options->add($comop);
############### COMMON OPTIONS END ############################
############### ADVANCED OPTIONS END ############################
my $all_adv_options = Gtk2::VBox->new(0,0);
my $adv_opt = Gtk2::HBox->new(0,0);
my $advanced_options = Gtk2::Frame->new("Advanced Options");
my $config = Gtk2::CheckButton->new("ConFig => ");
$tooltips->set_tip($config, "Use
defined configuration file
", ""); $config->signal_connect(toggled => sub{$ok_config = $config->get_active();});
my $config_arg = Gtk2::Entry->new();
$config_arg->set_width_chars (15);
my $sep_lab = Gtk2::Label->new("|||");
my $cgidirs = Gtk2::CheckButton->new("CgiDirs =>");
$tooltips->set_tip($cgidirs, "scan these CGI dirs:\ 'none\', \'all\', or values like \"/cgi/ /cgi-a/\"", "");
$cgidirs->signal_connect(toggled => sub{$ok_cgidirs = $cgidirs->get_active();});
my $cgidirs_arg = Gtk2::Entry->new();
$cgidirs_arg->set_width_chars (15);
my $sep_lab2 = Gtk2::Label->new(" |||");
my $id = Gtk2::CheckButton->new("H.Auth =>");
$tooltips->set_tip($id, "Host authentication to use, format is userid:password", "");
$id->signal_connect(toggled => sub{$ok_id = $id->get_active();});
my $id_arg = Gtk2::Entry->new();
$id_arg->set_width_chars (15);
my $sep_lab3 = Gtk2::Label->new("|||");
my $port = Gtk2::CheckButton->new("UsePort =>");
$tooltips->set_tip($port, "Port to use (default 80)", "");
$port->signal_connect(toggled => sub{$ok_port = $port->get_active();});
my $port_arg = Gtk2::Entry->new();
$port_arg->set_width_chars (15);
my $adv_opt_2 = Gtk2::HBox->new(0,0);
my $TimeOut = Gtk2::CheckButton->new("TimeOut =>");
$tooltips->set_tip($TimeOut, "Timeout (default 2 seconds)", "");
$TimeOut->signal_connect(toggled => sub{$ok_timeout = $TimeOut->get_active();});
my $TimeOut_arg = Gtk2::Entry->new();
$TimeOut_arg->set_width_chars (15);
my $TimeOut_lab = Gtk2::Label->new("|||");
my $Pause = Gtk2::CheckButton->new("Pause => ");
$tooltips->set_tip($Pause, "Pause between tests (seconds)", "");
$Pause->signal_connect(toggled => sub{$ok_pause = $Pause->get_active();});
my $Pause_arg = Gtk2::Entry->new();
$Pause_arg->set_width_chars (15);
my $Pause_lab = Gtk2::Label->new("|||");
my $Output = Gtk2::CheckButton->new("Output =>");
$tooltips->set_tip($Output, "Write output to defined file", "");
$Output->signal_connect(toggled => sub{$ok_output = $Output->get_active();});
my $Output_arg = Gtk2::Entry->new();
$Output_arg->set_width_chars (15);
my $Output_lab = Gtk2::Label->new("|||");
my $Display = Gtk2::CheckButton->new("Display =>");
$tooltips->set_tip($Display, "Turn on/off display outputs: [1] - Show redirects, [2] - Show cookies received
[3] - Show all 200/OK responses, [4] - Show URLs which require authentication,
[D] - Debug Output, [V] - Verbose Output", "");
$Display->signal_connect(toggled => sub{$ok_display = $Display->get_active();});
my $Display_arg = Gtk2::Entry->new();
$Display_arg->set_width_chars (15);
my $adv_opt_3 = Gtk2::HBox->new(0,0);
my $Evasion = Gtk2::CheckButton->new("Evasion => ");
$tooltips->set_tip($Evasion, "Ids evasion technique: [1] - Random URI encoding (non-UTF8),[2] - Directory
self-reference (/./), [3] - Premature URL ending, [4] - Prepend long random string,
[5] - Fake parameter, [6] - TAB as request spacer, [7] - Change the case of the
URL, [8] - Use Windows directory separator (\)", "");
$Evasion->signal_connect(toggled => sub{$ok_evasion = $Evasion->get_active();});
my $Evasion_arg = Gtk2::Entry->new();
$Evasion_arg->set_width_chars (15);
my $Evasion_lab = Gtk2::Label->new("|||");
my $Format = Gtk2::CheckButton->new("Format =>");
$tooltips->set_tip($Format, "Save file (-o) format: [htm] - HTML Format, [csv] -
Comma-separated-value, [txt] - Plain text (default if not specified)", "");
$Format->signal_connect(toggled => sub{$ok_format = $Format->get_active();});
my $Format_arg = Gtk2::Entry->new();
$Format_arg->set_width_chars (15);
my $Format_lab = Gtk2::Label->new("|||");
my $Mutate = Gtk2::CheckButton->new("Mutate =>");
$tooltips->set_tip($Mutate, "Guess additional file names: [1] - Test all files with all root directories,
[2] - Guess for password file names, [3] - Enumerate user names via Apache (/~user type requests),
[4] - Enumerate user names via cgiwrap (/cgi-bin/cgiwrap/~user type requests)", "");
$Mutate->signal_connect(toggled => sub{$ok_mutate = $Mutate->get_active();});
my $Mutate_arg = Gtk2::Entry->new();
$Mutate_arg->set_width_chars (15);
my $Mutate_lab = Gtk2::Label->new("|||");
my $Tunning = Gtk2::CheckButton->new("Tunning =>");
$tooltips->set_tip($Tunning, "Scan tuning: 0 -File Upload, 1 -Interesting File / Seen in logs,2 -Misconfiguration / Default File,3 -Information
Disclosure, 4 -Injection (XSS/Script/HTML), 5 -Remote File Retrieval -Inside Web Root, 6 -DoS, 7 -Remote
File Retrieval -Server Wide,8 -Command Execution / Remote Shell, 9 -SQL Injection, a -Authentication Bypass,
b -Software Identification, c -Remote Source Inclusion, x -Reverse Options (include all except specified)", "");
$Tunning->signal_connect(toggled => sub{$ok_tunning = $Tunning->get_active();});
my $Tunning_arg = Gtk2::Entry->new();
$Tunning_arg->set_width_chars (15);
my $adv_opt_4 = Gtk2::HBox->new(0,0);
my $Root = Gtk2::CheckButton->new("Root => ");
$tooltips->set_tip($Root, "Prepend root value to all requests, format is /directory", "");
$Root->signal_connect(toggled => sub{$ok_root = $Root->get_active();});
my $Root_arg = Gtk2::Entry->new();
$Root_arg->set_width_chars (45);
my $Root_lab = Gtk2::Label->new("|||");
my $VHost = Gtk2::CheckButton->new("VHost =>");
$tooltips->set_tip($VHost, "Write output to defined file", "");
$VHost->signal_connect(toggled => sub{$ok_vhost = $VHost->get_active();});
my $VHost_arg = Gtk2::Entry->new();
$VHost_arg->set_width_chars (45);
$adv_opt->pack_start($config,1,1,1);
$adv_opt->pack_start($config_arg,1,1,1);
$adv_opt->pack_start($sep_lab,1,1,1);
$adv_opt->pack_start($cgidirs,1,1,1);
$adv_opt->pack_start($cgidirs_arg,1,1,1);
$adv_opt->pack_start($sep_lab2,1,1,1);
$adv_opt->pack_start($id,1,1,1);
$adv_opt->pack_start($id_arg,1,1,1);
$adv_opt->pack_start($sep_lab3,1,1,1);
$adv_opt->pack_start($port,1,1,1);
$adv_opt->pack_start($port_arg,1,1,1);
$adv_opt_2->pack_start($TimeOut,1,1,1);
$adv_opt_2->pack_start($TimeOut_arg,1,1,1);
$adv_opt_2->pack_start($TimeOut_lab,1,1,1);
$adv_opt_2->pack_start($Pause,1,1,1);
$adv_opt_2->pack_start($Pause_arg,1,1,1);
$adv_opt_2->pack_start($Pause_lab,1,1,1);
$adv_opt_2->pack_start($Output,1,1,1);
$adv_opt_2->pack_start($Output_arg,1,1,1);
$adv_opt_2->pack_start($Output_lab,1,1,1);
$adv_opt_2->pack_start($Display,1,1,1);
$adv_opt_2->pack_start($Display_arg,1,1,1);
$adv_opt_3->pack_start($Evasion,1,1,1);
$adv_opt_3->pack_start($Evasion_arg,1,1,1);
$adv_opt_3->pack_start($Evasion_lab,1,1,1);
$adv_opt_3->pack_start($Format,1,1,1);
$adv_opt_3->pack_start($Format_arg,1,1,1);
$adv_opt_3->pack_start($Format_lab,1,1,1);
$adv_opt_3->pack_start($Mutate,1,1,1);
$adv_opt_3->pack_start($Mutate_arg,1,1,1);
$adv_opt_3->pack_start($Mutate_lab,1,1,1);
$adv_opt_3->pack_start($Tunning,1,1,1);
$adv_opt_3->pack_start($Tunning_arg,1,1,1);
$adv_opt_4->pack_start($Root,1,1,1);
$adv_opt_4->pack_start($Root_arg,1,1,1);
$adv_opt_4->pack_start($Root_lab,1,1,1);
$adv_opt_4->pack_start($VHost,1,1,1);
$adv_opt_4->pack_start($VHost_arg,1,1,1);
$all_adv_options->pack_start($adv_opt,1,1,1);
$all_adv_options->pack_start($adv_opt_2,1,1,1);
$all_adv_options->pack_start($adv_opt_3,1,1,1);
$all_adv_options->pack_start($adv_opt_4,1,1,1);
$advanced_options->add($all_adv_options);
############### ADVANCED OPTIONS END ############################
my $options = Gtk2::HBox->new(0,0);
my $frame2 = Gtk2::Frame->new();
my $rem_host = Gtk2::Label->new;
$frame2->add($rem_host);
$options->pack_start($frame2,1,1,1);
$rem_host->set_text("Nikto Gui Web Scanner");
my $frame3 = Gtk2::Frame->new();
my $rem_port = Gtk2::Label->new;
#$rem_port->set_width_chars(10);
$rem_port->set_text("Version 2.0");
$frame3->add($rem_port);
$options->pack_start($frame3,1,1,1);
my $btn_quit = Gtk2::Button->new_from_stock('gtk-quit');
$btn_quit->signal_connect("clicked" =>sub {exit;});
my $btn_about = Gtk2::Button->new_from_stock('gtk-about');
$btn_about->signal_connect("clicked" =>sub {About();});
my $nikto_info = Gtk2::Button->new_from_stock('Nikto Info');
$nikto_info->signal_connect("clicked" =>sub {
my $shell = (my $stdout, my $stderr);
$shell = qxx("perl nikto.pl -Version");
&update_buffer($MainBuffer,$shell);
});
my $nikto_up = Gtk2::Button->new_from_stock('Update Nikto');
$nikto_up->signal_connect("clicked" =>sub {
my $shell = (my $stdout, my $stderr);
$shell = qxx("perl nikto.pl -update");
&update_buffer($MainBuffer,$shell);
});
my $gui_up = Gtk2::Button->new_from_stock('Update GUI');
$gui_up->signal_connect("clicked" =>sub {
MessageBox(" At the current moment, this
project is not supported anymore
because Nikto development is stalled.
If Nikto development will be reactivated,
Gui version will be updated. ",
" Information ");
});
$options->pack_start($btn_about,1,1,1);
$options->pack_start($gui_up,1,1,1);
$options->pack_start($nikto_info,1,1,1);
$options->pack_start($nikto_up,1,1,1);
$options->pack_start($btn_quit,1,1,1);
$vbox->pack_start($options,0,0,0);
#$vbox->pack_start($image,0,0,0);
$vbox->pack_start($comon_options,0,0,0);
$vbox->pack_start($advanced_options,0,0,0);
#######################################################
#my $frame = Gtk2::Frame->new("Nikto Output");
$frame->set_border_width(5);
#my $sw = Gtk2::ScrolledWindow->new (undef, undef);
$sw->set_shadow_type ('etched-out');
$sw->set_policy ('automatic', 'automatic');
$sw->set_size_request (600, 300);
$sw->set_border_width(5);
#$tview = Gtk2::TextView->new();
$tview->set_editable(0);
$tview->set_cursor_visible (0);
#my $buffer = $tview->get_buffer();
$MainBuffer->create_mark ('end', $MainBuffer->get_end_iter, 0);
$MainBuffer->signal_connect (insert_text => sub {
$tview->scroll_to_mark ($MainBuffer->get_mark ('end'), 0.0, 1, 0, 0.5);});
$MainBuffer->create_tag ("mrX",foreground => "red",);
$MainBuffer->create_tag ("mrZ",foreground => "blue",);
$sw->add($tview);$frame->add($sw);
$supaBox->add($frame);
$vbox->pack_start($supaBox,1,1,4);
my $hbox = Gtk2::HBox->new(0,5);
my $ent_send = Gtk2::Entry->new;
my $ent_sent_frame = Gtk2::Frame->new();
$tooltips->set_tip($ent_sent_frame, "Host to scan", "");
$ent_sent_frame->add($ent_send);
$hbox->pack_start($ent_sent_frame,1,1,0);
my $btn_send = Gtk2::Button->new_from_stock('gtk-execute');
my $btn_clear = Gtk2::Button->new_from_stock('Clear Output');
$tooltips->set_tip($btn_send, "Execute scan! You can actually just hit ENTER", "");
$tooltips->set_tip($btn_clear, "Vipe out all output!", "");
$ent_send->signal_connect('key_press_event'=> sub {my ($widget,$event) = @_;
if($event->keyval == $Ret{Return}) {$btn_send->clicked;return 1;}});
#######################################################
$btn_send->signal_connect("clicked" =>sub {
my ($x1,$x2,$x3,$x4,$x5,$x6,$x7,$x8,$x9,$x10,$x11,$x12,$x13,$x14,$x15,$x16,$x17,$x18,$x19,$x20);
my ($z1,$z2,$z3,$z4,$z5,$z6,$z7,$z8,$z9,$z10,$z11,$z12,$z13,$z14); # over ...
# common options
if ($ok_dbcheck eq "1"){ $x1 = "-dbcheck"; } else { $x1 = ""; } if ($ok_findonly eq "1"){ $x2 = "-findonly"; } else { $x2 = ""; }
if ($ok_nolookup eq "1"){ $x3 = "-nolookup"; } else { $x3 = ""; } if ($ok_ssl eq "1"){ $x4 = "-ssl"; } else { $x4 = ""; }
if ($ok_single eq "1"){ $x5 = "-Single"; } else { $x5 = ""; } if ($ok_useproxy eq "1"){ $x6 = "-useproxy"; } else { $x6 = ""; }
# advanced options
if ($ok_config eq "1"){ $x7 = "-config"; } else { $x7 = ""; } if ($ok_cgidirs eq "1"){ $x8 = "-Cgidirs"; } else { $x8 = ""; }
if ($ok_id eq "1"){ $x9 = "-id"; } else { $x9 = ""; } if ($ok_port eq "1"){ $x10 = "-port"; } else { $x10 = ""; }
if ($ok_timeout eq "1"){ $x11 = "-timeout"; } else { $x11 = ""; } if ($ok_pause eq "1"){ $x12 = "-Pause"; } else { $x12 = ""; }
if ($ok_display eq "1"){ $x13 = "-Display"; } else { $x13 = ""; } if ($ok_evasion eq "1"){ $x14 = "-evasion"; } else { $x14 = ""; }
if ($ok_format eq "1"){ $x15 = "-Format"; } else { $x15 = ""; } if ($ok_mutate eq "1"){ $x16 = "-mutate"; } else { $x16 = ""; }
if ($ok_tunning eq "1"){ $x17 = "-Tuning"; } else { $x17 = ""; } if ($ok_root eq "1"){ $x18 = "-root"; } else { $x18 = ""; }
if ($ok_output eq "1"){ $x19 = "-output"; } else { $x19 = ""; } if ($ok_vhost eq "1"){ $x20 = "-vhost"; } else { $x20 = ""; }
my $url = $ent_send->get_text;
$z1 = $config_arg->get_text; # value of "config" argv
$z2 = $cgidirs_arg->get_text; # value of "Cgidirs" argv
$z3 = $id_arg->get_text; # value of "id" argv
$z4 = $port_arg->get_text; # value of "port" argv
$z5 = $TimeOut_arg->get_text; # value of "timeout" argv
$z6 = $Pause_arg->get_text; # value of "Pause" argv
$z7 = $Output_arg->get_text; # value of "output" argv
$z8 = $Display_arg->get_text; # value of "Display" argv
$z9 = $Evasion_arg->get_text; # value of "evasion" argv
$z10 = $Format_arg->get_text; # value of "Format" argv
$z11 = $Mutate_arg->get_text; # value of "mutate" argv
$z12 = $Tunning_arg->get_text; # value of "Tuning" argv
$z13 = $Root_arg->get_text; # value of "root" argv
$z14 = $VHost_arg->get_text; # value of "vhost" argv
if($GUI_OUTPUT eq ""){
my $shell = (my $stdout, my $stderr);
$shell = qxx( "perl nikto.pl -host $url $x1 $x2 $x3 $x4 $x5 $x6 $x7 $z1 $x8 $z2 $x9 $z3 $x10 $z4 $x11 $z5 $x12 $z6 $x13 $z8 $x14 $z9 $x15 $z10 $x16 $z11 $x17 $z12 $x18 $z13 $x19 $z7 $x20 $z14");
&update_buffer($MainBuffer,$shell);
return 1;
} elsif($GUI_OUTPUT eq "1"){
exec( "perl nikto.pl -host $url $x1 $x2 $x3 $x4 $x5 $x6 $x7 $z1 $x8 $z2 $x9 $z3 $x10 $z4 $x11 $z5 $x12 $z6 $x13 $z8 $x14 $z9 $x15 $z10 $x16 $z11 $x17 $z12 $x18 $z13 $x19 $z7 $x20 $z14");
}
});
$btn_clear->signal_connect("clicked" =>sub {
my $clearbuffer = $tview->get_buffer;
$clearbuffer->delete($clearbuffer->get_start_iter, $clearbuffer->get_end_iter);
$tview->set_buffer($clearbuffer);
});
$hbox->pack_start($btn_send,1,1,0);
$hbox->pack_end($btn_clear,1,1,0);
$vbox->pack_start($hbox,1,1,4);
$vbox->set_focus_child($hbox);
$vbox->show_all();
return $vbox;
}
sub update_buffer {
my ($buffer,$msg)= @_;$msg = $msg."\n";
my $iter = $buffer->get_end_iter;
$buffer->insert_with_tags_by_name($iter, "$msg");
}